<?php

namespace app\admin\model\music;

use app\logic\model\music\MusicSelectedPackDetailLogicModel;

class MusicSelectedPackDetailModel extends MusicSelectedPackDetailLogicModel
{

    public function saveDetail($id, $detail)
    {
        $this->where('pack_id',$id)->delete();
        foreach ($detail as $val){
            $val['pack_id']=$id;
            $insert[]=$val;
        }
        if(!empty($insert)){
            $this->saveAll($insert);
        }
    }
}